package com.designPattern.foctory.absFactory.factory.factoryImpl;

import com.designPattern.foctory.absFactory.instance.GoodInstance;
import com.designPattern.foctory.absFactory.instance.Instance;
import com.designPattern.foctory.absFactory.instance.GreatInstance;
import com.designPattern.foctory.absFactory.factory.AbsInstanceFactory;

/**
 * @author mxs
 */
public class GoodInstanceFactory implements AbsInstanceFactory {
    @Override
    public Instance createInstance(String instanceType) {
        Instance instance = null;
        if (instanceType.equals(GoodInstance.class.getName())){
            instance = new GoodInstance();
        }else if (instanceType.equals(GreatInstance.class.getName())){
            instance = new GreatInstance();
        }return instance;
    }
}
